﻿@model Zor_Web.Models.Base.V_Zor_Summary_Operation  
@using Webdiyer.WebControls.Mvc;
@using Zor_Tools;
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>汇总</title>
    <link href="~/Content/LayerUI/src/css/layui.css" rel="stylesheet" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/Styles/zor.css" rel="stylesheet" />
    <!-- 框架必要 -->
    <script src="~/Content/Scripts/jquery/jquery-1.9.1.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <script src="~/Content/Scripts/Zor_AJax.js"></script>
    <!-- 消息提示 -->
    <script language='javascript' src='~/Content/layer/layer.js'></script>
    <!-- 日期选择器 -->
    <script src="~/Content/laydate/laydate.js"></script>

</head>
<body class="gray-bg">
    <div class="layui-tab layui-tab-brief main-tab-container ">
        <div class="col-sm-12 ct-padding">
            <div class="col-sm-9 ct-padding">
                <button id="btnSure" class="layui-btn layui-btn layui-btn-small"><span class="glyphicon glyphicon-ok"></span> 汇总</button>
            </div>
        </div>
    </div>
    <div class="col-sm-12  layui-tab-content">
        <div class="mail-box" style="overflow-x:scroll;white-space:nowrap;">
            <table class="layui-table" lay-skin="line">
                <thead>
                    <tr>
                        <th hidden></th>
                        <th><input type="checkbox" name="checkAll" id="cbkCheckAll"></th>
                        <th>社区</th>
                        <th>受理单号</th>
                        <th>个人所得税(元)</th>
                        <th>房产税(元)</th>
                        <th>税金(元)</th>
                        <th>起征日期</th>
                        <th>征止日期</th>
                        <th>缴税日期</th>
                        <th>经办人</th>
                        <th>房屋属性</th>
                        <th>纳税人</th>
                        <th>联系方式</th>
                        <th>面积</th>
                    </tr>
                </thead>
                <tbody id="accordion">
                    @foreach (var item in Model.PageData)
                    {
                    <tr>
                        <td hidden>@item.Sm_Id</td>
                        <td><input type="checkbox" name="chk" id="@item.Sm_Id" value="@item.Sm_Id-@item.Acceptance_Id-@item.ETax-@item.BD_Id-@item.EPersonalTax-@item.EPropertyTax" /></td>
                        <td>@item.CommunityName</td>
                        <td>@item.Acceptance_TicketNumber</td>
                        <td>@(item.EPersonalTax * 0.01)</td>
                        <td>@(item.EPropertyTax * 0.01)</td>
                        <td>@(item.ETax*0.01)</td>
                        <td>@TimeHelper.TimeStampToDateTime(item.Acceptance_TaxStartTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                        <td>@TimeHelper.TimeStampToDateTime(item.Acceptance_TaxEndTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                        <td>@TimeHelper.TimeStampToDateTime(item.Pt_Date.ToString(), TimeHelper.ToTimeType.link_ymd)</td>
                        <td>@item.InUser</td>
                        <td>@item.AHA</td>
                        <td>@item.NatPer_Name</td>
                        <td>@item.NatPer_Phone</td>
                        <td>@item.Hs_Proportion</td>
                        <td hidden>@item.Acceptance_Id</td>
                    </tr>
                    }
                </tbody>
            </table>

            <div class="col-sm-12">
                <div class="col-sm-10">
                    @Html.Pager(Model.PageData, new PagerOptions { PageIndexParameterName = "index", ContainerTagName = "ul", PrevPageText = "上页", NextPageText = "下页", FirstPageText = "首页", LastPageText = "尾页", CssClass = "pagination", PagerItemsSeperator = "", CurrentPagerItemWrapperFormatString = "<li class=\"active\"><a href=\"#\">{0}</a></li>", PagerItemWrapperFormatString = "<li>{0}</li>" }, new { id = "bootstrappager", @class = "pagination" })
                </div>
                <div class="col-sm-2 to-righjt">
                    共 @Model.PageData.TotalItemCount 条记录，页 @Model.PageData.CurrentPageIndex/@Model.PageData.TotalPageCount
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    /**
        * 全选
        */
    $(function () {
        $("#cbkCheckAll").click(function () {
            if (this.checked) {
                $("input[name='chk']").prop('checked', true);
            } else {
                $("input[name='chk']").prop('checked', false);
            }
        })
    })

    /**
    * 保存
    */
    $(function () {
        $("#btnSure").click(function () {
            var strs = "";
                strs = CheckboxValueIDs();           
            if (strs.length == 0) {
                layer.msg("请选择要汇总的信息！");                                                             //未选中任何行
                return;
            } 
            ZorPostSimpleData("/Base/UpdateSummary", JSON.stringify({ 'strb': strs }), function (data) {
                layer.msg(data.AnswerMeg, function () {
                    layer.closeAll();
                    Replace();
                });
            });
        })
    })
</script>